#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int

#define YES cout << "Yes" << '\n'
#define NO cout << "No" << '\n'
#define endl '\n'
const int INF = 1e9;
const int MOD = 1;
using namespace std;
/*思考
 *相同个数变化只会+2或-2
 *先找到最小相同个数，再逐个加二，看是否能与k相等
 */

void solve()
{
    int cnt0 = 0;
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++)
    {
        if (s[i] == '0')
        {
            cnt0++; // 0的个数
        }
    }
    int big = max(cnt0, n - cnt0);
    int small = n - big;
    int yes_min = (big - small) / 2;
    for (int i = yes_min; i <= n / 2; i += 2)
    {
        if (i == k)
        {
            YES;
            return;
        }
    }
    NO;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--)
        solve();
    return 0;
}